// Author: 		ngohaibac@hocdelam.org
// Date:		26th Oct, 2009
// Hardware:	TMS320F28335
// Module:		LCD Module	base on External Interface

/* Hardware: 
		LCD_RS		~ 	Data_0
		LCD_RW		~ 	Ground
		LCD_E		~   Data_2
		
		LCD_Data_4	~ 	Data_4
		LCD_Data_5	~ 	Data_5
		LCD_Data_6	~	Data_6
		LCD_Data_7  ~	Data_7
		
		LCD_Module: External Inteface 0: A9 = 1, A10, A11 = 0 => Address: 0x4100		
		#define		LCD_XINTF_ADDR		(volatile Uint16 *)0x4100
 * */

#ifndef DSP2833X_LCDLIB_H_
#define DSP2833X_LCDLIB_H_

#ifdef __cplusplus
extern "C" {
#endif

//#define		LCD_XINTF_ADDR		(volatile Uint16 *)0x4100
#define EXT_BUS_LCD			*(volatile Uint16 *)(0x004100)

// Main functions
void LCD_Init(void);
void LCD_gotoXY(Uint16 x, Uint16 y);

void LCD_PrString(char *str);
void LCD_PrChar(Uint16 c);
void LCD_PrHex(Uint16 hex_data,Uint16 number_of_digit);
void LCD_PrDec(Uint16 hex_data,Uint16 number_of_digit);

void LCD_Command(Uint16 command);

// Utility
#define	LCD_COMMAND_CLEAR			0x01
#define	LCD_COMMAND_HOME			0x02
#define LCD_COMMAND_CUSTOR_OFF		0x0C
#define	LCD_COMMAND_CUSTOR_ON		0x0D


#ifdef __cplusplus
}
#endif /* extern "C" */

#endif /*DSP2833X_LCDLIB_H_*/
